package com.zzxx.mapper;

import com.zzxx.entity.User;
import com.zzxx.entity.UserExample;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

public interface UserMapperEx {
    @SelectProvider(type=UserSqlProvider.class, method="selectByExample")
    @Results({
            @Result(column="id", property="id", jdbcType= JdbcType.VARCHAR, id=true),
            @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
            @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
            @Result(column="birthday", property="birthday", jdbcType=JdbcType.DATE),
            @Result(column="phoneNum", property="phonenum", jdbcType=JdbcType.CHAR),
            @Result(column="identityNum", property="identitynum", jdbcType=JdbcType.CHAR),
            @Result(column="sex", property="sex", jdbcType=JdbcType.INTEGER),
            @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
            @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
            @Result(column="realName", property="realname", jdbcType=JdbcType.VARCHAR),
            @Result(column="src", property="src", jdbcType=JdbcType.VARCHAR),
            @Result(column = "money" ,property = "money",jdbcType = JdbcType.DATE),
            @Result(column = "id",property = "coupon",many = @Many(select = "com.zzxx.mapper.CouponMapper.selectByUid"))
    })
    List<User> selectByExample1(UserExample example);
}
